//kZime
#include <iostream>
#include <cstdio>
using namespace std;
int m, n;

inline int get_num() {
	int ans = 0, f = 1;
	char c = getchar();
	for(; !isdigit(c); c = getchar()) if(c == '-') f = -1;
	for(; isdigit(c); c = getchar()) ans = ans * 10 + c - '0';
	return ans * f;
}

int fast_mi(int now, int time) {
	int res = 1;
	while(time) {
		res *= (time & 1) ? now : 1;
		now *= now;
		time = time >> 1;
	}
	return res;
}

int main() {
	n = get_num();
	m = get_num();
	printf("%d", fast_mi(n, m));
}
